home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / prolog.lang < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  8.3 KB  |  249 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Authors: Ignacio Casal Quinteiro
  5.  Copyright (C) 2009 Ignacio Casal Quinteiro <icq@gnome.org>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="prolog" _name="Prolog" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-prolog</property>
  26.     <property name="globs">*.prolog</property>
  27.     <property name="line-comment-start">%</property>
  28.     <property name="block-comment-start">/*</property>
  29.     <property name="block-comment-end">*/</property>
  30.   </metadata>
  31.  
  32.   <styles>
  33.     <style id="comment"           _name="Comment"           map-to="def:comment"/>
  34.     <style id="variable"          _name="Variable"          map-to="def:type"/>
  35.     <style id="keyword"           _name="Keyword"           map-to="def:keyword"/>
  36.     <style id="string"            _name="String"            map-to="def:string"/>
  37.     <style id="number"            _name="Number"            map-to="def:decimal"/>
  38.     <style id="operator"          _name="Operator"          map-to="def:operator"/>
  39.     <style id="error"             _name="Error"             map-to="def:error"/>
  40.     <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
  41.   </styles>
  42.  
  43.   <definitions>
  44.     
  45.     <define-regex id="symbolchar">[-!+\\|=:&><]</define-regex>
  46.  
  47.     <define-regex id="escaped-character" extended="true">
  48.             \\(                   # leading backslash
  49.             [\\\"\'nrbtfav\?] |   # escaped character
  50.             [0-7]{1,3} |          # one, two, or three octal digits
  51.             x[0-9A-Fa-f]+         # 'x' followed by hex digits
  52.             )
  53.     </define-regex>
  54.  
  55.     <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
  56.       <start>%</start>
  57.       <include>
  58.         <context ref="def:in-comment"/>
  59.       </include>
  60.     </context>
  61.  
  62.     <context id="block-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
  63.       <start>/\*</start>
  64.       <end>\*/</end>
  65.       <include>
  66.         <context ref="def:in-comment"/>
  67.       </include>
  68.     </context>
  69.     
  70.     <context id="close-comment-outside-comment" style-ref="error">
  71.       <match>\*/(?!\*)</match>
  72.     </context>
  73.  
  74.     <context id="variable" style-ref="variable">
  75.       <match>\b(_|[A-Z][A-Za-z0-9_]*)\b</match>
  76.     </context>
  77.     
  78.     <context id="operators" style-ref="operator">
  79.       <prefix>(?<!\%{symbolchar})</prefix>
  80.       <suffix>(?!\%{symbolchar})</suffix>
  81.       <keyword>=</keyword>
  82.       <keyword>==</keyword>
  83.       <keyword>=\\=</keyword>
  84.       <keyword>=:=</keyword>
  85.       <keyword>\|</keyword>
  86.       <keyword><</keyword>
  87.       <keyword>></keyword>
  88.       <keyword>=<</keyword>
  89.       <keyword>>=</keyword>
  90.       <keyword>\\=</keyword>
  91.       <keyword>\\==</keyword>
  92.       <keyword>\\\+</keyword>
  93.     </context>
  94.     
  95.     <context id="special-operators" style-ref="operator">
  96.       <match>([!;]|:\-)</match>
  97.     </context>
  98.  
  99.     <context id="escaped-character" style-ref="escaped-character">
  100.           <match>\%{escaped-character}</match>
  101.     </context>
  102.  
  103.     <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
  104.       <start>"</start>
  105.       <end>"</end>
  106.       <include>
  107.         <context ref="escaped-character"/>
  108.       </include>
  109.     </context>
  110.  
  111.     <context id="string2" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
  112.       <start>'</start>
  113.       <end>'</end>
  114.       <include>
  115.         <context ref="escaped-character"/>
  116.       </include>
  117.     </context>
  118.  
  119.     <context id="number" style-ref="number">
  120.       <match extended="true">
  121.         \b[0-9]+(\.[0-9]+)?\b
  122.       </match>
  123.     </context>
  124.  
  125.     <context id="arith" style-ref="keyword">
  126.       <keyword>mod</keyword>
  127.       <keyword>div</keyword>
  128.       <keyword>abs</keyword>
  129.       <keyword>exp</keyword>
  130.       <keyword>ln</keyword>
  131.       <keyword>log</keyword>
  132.       <keyword>sqrt</keyword>
  133.       <keyword>round</keyword>
  134.       <keyword>trunc</keyword>
  135.       <keyword>val</keyword>
  136.       <keyword>cos</keyword>
  137.       <keyword>sin</keyword>
  138.       <keyword>tan</keyword>
  139.       <keyword>arctan</keyword>
  140.       <keyword>random</keyword>
  141.       <keyword>randominit</keyword>
  142.     </context>
  143.  
  144.     <context id="keyword" style-ref="keyword">
  145.       <keyword>module</keyword>
  146.       <keyword>meta_predicate</keyword>
  147.       <keyword>multifile</keyword>
  148.       <keyword>dynamic</keyword>
  149.       <keyword>abolish</keyword>
  150.       <keyword>current_output</keyword>
  151.       <keyword>peek_code</keyword>
  152.       <keyword>append</keyword>
  153.       <keyword>current_predicate</keyword>
  154.       <keyword>put_byte</keyword>
  155.       <keyword>arg</keyword>
  156.       <keyword>current_prolog_flag</keyword>
  157.       <keyword>put_char</keyword>
  158.       <keyword>asserta</keyword>
  159.       <keyword>assert</keyword>
  160.       <keyword>fail</keyword>
  161.       <keyword>put_code</keyword>
  162.       <keyword>assertz</keyword>
  163.       <keyword>findall</keyword>
  164.       <keyword>read</keyword>
  165.       <keyword>at_end_of_stream</keyword>
  166.       <keyword>float</keyword>
  167.       <keyword>read_term</keyword>
  168.       <keyword>atom</keyword>
  169.       <keyword>flush_output</keyword>
  170.       <keyword>repeat</keyword>
  171.       <keyword>atom_chars</keyword>
  172.       <keyword>functor</keyword>
  173.       <keyword>retract</keyword>
  174.       <keyword>atom_codes</keyword>
  175.       <keyword>get_byte</keyword>
  176.       <keyword>set_input</keyword>
  177.       <keyword>atom_concat</keyword>
  178.       <keyword>get_char</keyword>
  179.       <keyword>set_output</keyword>
  180.       <keyword>atom_length</keyword>
  181.       <keyword>get_code</keyword>
  182.       <keyword>set_prolog_flag</keyword>
  183.       <keyword>atomic</keyword>
  184.       <keyword>halt</keyword>
  185.       <keyword>set_stream_position</keyword>
  186.       <keyword>bagof</keyword>
  187.       <keyword>integer</keyword>
  188.       <keyword>setof</keyword>
  189.       <keyword>call</keyword>
  190.       <keyword>is</keyword>
  191.       <keyword>stream_property</keyword>
  192.       <keyword>catch</keyword>
  193.       <keyword>nl</keyword>
  194.       <keyword>sub_atom</keyword>
  195.       <keyword>char_code</keyword>
  196.       <keyword>nonvar</keyword>
  197.       <keyword>throw</keyword>
  198.       <keyword>char_conversion</keyword>
  199.       <keyword>number</keyword>
  200.       <keyword>clause</keyword>
  201.       <keyword>number_chars</keyword>
  202.       <keyword>unify_with_occurs_check</keyword>
  203.       <keyword>close</keyword>
  204.       <keyword>number_codes</keyword>
  205.       <keyword>var</keyword>
  206.       <keyword>compound</keyword>
  207.       <keyword>once</keyword>
  208.       <keyword>copy_term</keyword>
  209.       <keyword>op</keyword>
  210.       <keyword>write</keyword>
  211.       <keyword>writeln</keyword>
  212.       <keyword>write_canonical</keyword>
  213.       <keyword>write_term</keyword>
  214.       <keyword>writeq</keyword>
  215.       <keyword>current_char_conversion</keyword>
  216.       <keyword>open</keyword>
  217.       <keyword>current_input</keyword>
  218.       <keyword>peek_byte</keyword>
  219.       <keyword>current_op</keyword>
  220.       <keyword>peek_char</keyword>
  221.       <keyword>false</keyword>
  222.       <keyword>true</keyword>
  223.       <keyword>consult</keyword>
  224.       <keyword>member</keyword>
  225.       <keyword>memberchk</keyword>
  226.       <keyword>reverse</keyword>
  227.       <keyword>permutation</keyword>
  228.       <keyword>delete</keyword>
  229.     </context>
  230.  
  231.     <context id="prolog" class="no-spell-check">
  232.       <include>
  233.         <context ref="keyword"/>
  234.         <context ref="arith"/>
  235.         <context ref="number"/>
  236.         <context ref="string"/>
  237.         <context ref="string2"/>
  238.         <context ref="special-operators"/>
  239.         <context ref="operators"/>
  240.         <context ref="variable"/>
  241.         <context ref="block-comment"/>
  242.         <context ref="line-comment"/>
  243.         <context ref="close-comment-outside-comment"/>
  244.       </include>
  245.     </context>
  246.  
  247.   </definitions>
  248. </language>
  249.